﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ATMServiceLibrary.DTO;
using System.Data.OleDb;
using System.Runtime.Serialization;
namespace ATMServiceLibrary.DAO
{

    [DataContract]
    class GiaoDichRutTienDAO:DataProvider
    {
        public void ThemGiaoDichRutTien(GiaoDichRutTienDTO giaoDich)
        {
  
                connect();
                this.command = connection.CreateCommand();
                command.CommandText = "INSERT INTO GIAODICHRUTTIEN(MaThe,SoTienRut,ThoiGianGiaoDich) VALUES(@MaThe,@SoTienRut,@ThoiGianGiaoDich)";
                OleDbParameter para = command.Parameters.Add("@MaThe", OleDbType.VarWChar);
                para.Value = giaoDich.MaThe;

                para = command.Parameters.Add("@SoTienRut", OleDbType.Double);
                para.Value = giaoDich.SoTien;

                para = command.Parameters.Add("@ThoiGianGiaoDich", OleDbType.VarWChar);
                para.Value = giaoDich.ThoiGianGiaoDich.ToString();

                command.ExecuteNonQuery();

        }
        
    }
}
